1. Field of the Invention
This invention relates to routing table lookup.
2. Related Art
In a computer network, routing devices receive messages at one of a set of input interfaces, and forward them on to one of a set of output interfaces. It is advantageous for such routing devices to operate as quickly as possible, to keep up with the rate of incoming messages. In a packet routing network, each packet includes a header, including information used for routing the packet to an output interface for forwarding to a destination device (or to another routing device for further forwarding). Header information used for routing can include a destination address, a source address, and other information such as a destination device port, a source device port, a protocol, packet length, and a priority for the packet. Header information used by routing devices for other administrative tasks can include information about access control, accounting, quality of service, and other purposes.
One problem in the known art is that there can be a relatively large number of possible destinations, and therefore a correspondingly large number of possible output interfaces (herein called "routes"), one of which is to be associated with the incoming packet. It is advantageous for the routing devices to match the associated output interface with the incoming packet as quickly as possible. Due to the nature of routing in computer networks, it is also advantageous for the routing devices to match the associated output interface with the longest possible sub-string of the header information (such as the destination address or a combination of the destination address and the source address).
One method in the known art is to use a branching tree, which differentiates among possible routes in response to each individual bit of the header information. A variant of this method is to generate an M-way branching tree (herein called an "M-trie," which has up to M possible branches at each node). An M-trie differentiates among possible routes in response to groups of bits in the header information.
One problem in the known art is that using M-tries generates frequent references to memory to access the nodes of the M-trie. The access speed of the memory thus provides a limitation on the speed of the routing device. Moreover, some of the nodes of the M-trie near its root are relatively more frequently referenced than other nodes. The access speed of the memory for repeated references to the same location thus provides a second limitation on the speed of the routing device.
Accordingly, it would be desirable to provide a method and system for rapid access to one or more M-tries for responding to header information. This advantage is achieved in an embodiment of the invention in which the M-tries are stored in a plurality of memory banks, some of which duplicate parts of the M-tries that are frequently referenced.